package com.spzx.alex008cache20250513.controller;

import com.spzx.alex008cache20250513.entity.User;
import com.spzx.alex008cache20250513.service.Alex008UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;

@RestController
@RequestMapping("/users")
@RequiredArgsConstructor
public class Alex008UserController {

    @Autowired
    private  Alex008UserService userService;
    
    @GetMapping("/{id}")
    public User getUser(@PathVariable Long id) {
        return userService.getUser(id);
    }
    
    @PutMapping
    public void updateUser(@RequestBody User user) {
        userService.updateUser(user);
    }
}